package com.mj.haier.calc.repository;

import com.mj.haier.calc.domain.Order;
import org.springframework.data.jpa.repository.*;
import org.springframework.stereotype.Repository;

import java.util.Optional;


/**
 * Spring Data  repository for the Order entity.
 */
@SuppressWarnings("unused")
@Repository
public interface OrderRepository extends JpaRepository<Order, Long> {

    /**
     * 通过 orderId 获取对象
     * @param orderId
     * @return
     */
    Optional<Order> findByOrderId(Long orderId);

    /**
     * 删除对象
     * @param orderId
     */
    void deleteByOrderId(Long orderId);
}
